import request from '@/utils/request'
/**
 * 获取用户信息
 * @param params  token
 * @returns 
 */
export const getUserInfo = () => {
  return request({
    url: '/system/user/profile',
    method: 'get',
  })
}
// 修改用户信息
export const editUserInfo = (data: any) => {
  return request({
    url: '/system/user/profile',
    method: 'put',
    data
  })
}
/**
 * 修改密码
 * @param data 
 * @returns 
 */
export const editUserPsw = (params: any) => {
  return request({
    url: '/system/user/profile/updatePwd',
    method: 'put',
    params
  })
}
/**
 * 获取用户浏览历史
 * @returns 
 */
export const getHistoryList = (params: any) => {
  return request({
    url: '/user/history/list',
    method: 'get',
    params
  })
}
/**
 * 获取博客用户信息
 * @param params 
 * @returns 
 */
export const getUserBlogInfo = (params: any) => {
  return request({
    url: '/anon/user',
    method: 'get',
    params
  })
}
/**
 * 获取关注列表
 * @param params 
 * @returns 
 */
export const getUserFollows = (params: any) => {
  return request({
    url: '/anon/follow/follows',
    method: 'get',
    params
  })
}
/**
 * 获取粉丝列表
 * @param params 
 * @returns 
 */
export const getUserFans = (params: any) => {
  return request({
    url: '/anon/follow/fans',
    method: 'get',
    params
  })
}
/**
 * 关注
 * @param data 
 * @returns 
 */
export const followUser = (data: any) => {
  return request({
    url: '/user/follow',
    method: 'post',
    data
  })
}